<?php

namespace App\Http\Controllers\user;

use App\Dao\BusinessesDao;
use App\Dao\LineUpPriceDao;
use App\Services\Code;
use App\Services\WechatServices;

class BusinessesController extends BaseController
{
    public function businesses(): array
    {
        return Code::message('',200,BusinessesDao::businesses([
            'show'=>1
        ]));
    }


    public function lines(): array
    {
        $all = request()->all();
        $all['status'] = 0;

        return Code::message('',200,LineUpPriceDao::lines($all));
    }

    public function myLines(): array
    {
        $params = request()->all();
        $params['user_id'] = getUserToken();
        return Code::message('',200,LineUpPriceDao::lines($params));
    }

    public function lines_ranking()
    {
        $params = request()->all();
        $params['user_id'] = getUserToken();
        return Code::message('',200,LineUpPriceDao::lines_ranking($params));
    }


    public function pay(): array
    {
        $params = request()->all();
        $params['user_id'] = getUserToken();
        return Code::message('',200,BusinessesDao::pay($params));
    }

    public function qr_code()
    {
        $params = request()->all();
        return Code::message('',200,WechatServices::qr_code($params));
    }

    public function quitOrder(){
        $params = request()->all();
        return Code::message('',200,BusinessesDao::quitOrder($params));
    }

}
